home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / answers / cryptography-faq / part04 < prev    next >
Encoding:
Internet Message Format  |  1993-06-18  |  10.7 KB

  1. Path: senator-bedfellow.mit.edu!enterpoop.mit.edu!pad-thai.aktis.com!pad-thai.aktis.com!not-for-mail
  2. From: crypt-comments@math.ncsu.edu
  3. Newsgroups: sci.crypt,sci.answers,news.answers
  4. Subject: Cryptography FAQ (04/10: Mathematical Cryptology; last mod 19930504)
  5. Supersedes: <cryptography-faq/part04_738648006@GZA.COM>
  6. Followup-To: poster
  7. Date: 19 Jun 1993 00:00:25 -0400
  8. Organization: The Crypt Cabal
  9. Lines: 205
  10. Sender: faqserv@GZA.COM
  11. Approved: news-answers-request@MIT.Edu
  12. Expires: 24 Jul 1993 04:00:05 GMT
  13. Message-ID: <cryptography-faq/part04_740462405@GZA.COM>
  14. References: <cryptography-faq/part01_740462405@GZA.COM>
  15. Reply-To: crypt-comments@math.ncsu.edu
  16. NNTP-Posting-Host: pad-thai.aktis.com
  17. X-Last-Updated: 1993/05/06
  18. Xref: senator-bedfellow.mit.edu sci.crypt:17442 sci.answers:259 news.answers:9555
  19.  
  20. Archive-name: cryptography-faq/part04
  21.  
  22.  
  23. This is the fourth of ten parts of the sci.crypt FAQ. The parts are
  24. mostly independent, but you should read the first part before the rest.
  25. We don't have the time to send out missing parts by mail, so don't ask.
  26. Notes such as ``[KAH67]'' refer to the reference list in the last part.
  27.  
  28. The sections of this FAQ are available via anonymous FTP to rtfm.mit.edu 
  29. as /pub/usenet/news.answers/cryptography-faq/part[xx]. The Cryptography 
  30. FAQ is posted to the newsgroups sci.crypt, sci.answers, and news.answers
  31. every 21 days.
  32.  
  33.  
  34. Contents:
  35.  
  36. 4.1. In mathematical terms, what is a private-key cryptosystem?
  37. 4.2. What is an attack?
  38. 4.3. What's the advantage of formulating all this mathematically?
  39. 4.4. Why is the one-time pad secure?
  40. 4.5. What's a ciphertext-only attack?
  41. 4.6. What's a known-plaintext attack?
  42. 4.7. What's a chosen-plaintext attack?
  43. 4.8. In mathematical terms, what can you say about brute-force attacks?
  44. 4.9. What's a key-guessing attack? What's entropy?
  45.  
  46.  
  47. Reader, beware: This section is highly mathematical. Well, maybe not
  48. _highly_ mathematical, but it's got a bunch of symbols and scary-looking
  49. formulas. You have been warned.
  50.  
  51.  
  52. 4.1. In mathematical terms, what is a private-key cryptosystem?
  53.  
  54.   A private-key cryptosystem consists of an encryption system E and a
  55.   decryption system D. The encryption system E is a collection of
  56.   functions E_K, indexed by ``keys'' K, mapping some set of
  57.   ``plaintexts'' P to some set of ``ciphertexts'' C. Similarly the
  58.   decryption system D is a collection of functions D_K such that
  59.   D_K(E_K(P)) = P for every plaintext P. That is, succesful decryption
  60.   of ciphertext into plaintext is accomplished using the same key
  61.   (index) as was used for the corresponding encryption of plaintext
  62.   into ciphertext. Such systems, where the same key value is used to
  63.   encrypt and decrypt, are also known as ``symmetric'' cryptoystems.
  64.  
  65. 4.2. What is an attack?
  66.  
  67.   In intuitive terms a (passive) attack on a cryptosystem is any method
  68.   of starting with some information about plaintexts and their
  69.   corresponding ciphertexts under some (unknown) key, and figuring out
  70.   more information about the plaintexts. It's possible to state
  71.   mathematically what this means. Here we go.
  72.  
  73.   Fix functions F, G, and H of n variables. Fix an encryption system E,
  74.   and fix a distribution of plaintexts and keys.
  75.  
  76.   An attack on E using G assuming F giving H with probability p is an
  77.   algorithm A with a pair f, g of inputs and one output h, such that
  78.   there is probability p of computing h = H(P_1,...,P_n), if we have
  79.   f = F(P_1,...,P_n) and g = G(E_K(P_1),...,E_K(P_n)). Note that this
  80.   probability depends on the distribution of the vector (K,P_1,...,P_n).
  81.  
  82.   The attack is trivial (or ``pointless'') if there is probability at
  83.   least p of computing h = H(P_1,...,P_n) if f = F(P_1,...,P_n) and
  84.   g = G(C_1,...,C_n). Here C_1,...,C_n range uniformly over the possible
  85.   ciphertexts, and have no particular relation to P_1,...,P_n. In other
  86.   words, an attack is trivial if it doesn't actually use the encryptions
  87.   E_K(P_1),...,E_K(P_n).
  88.  
  89.   An attack is called ``one-ciphertext'' if n = 1, ``two-ciphertext'' if
  90.   n = 2, and so on.
  91.  
  92. 4.3. What's the advantage of formulating all this mathematically?
  93.  
  94.   In basic cryptology you can never prove that a cryptosystem is secure.
  95.   Read part 3: we keep saying ``a strong cryptosystem must have this
  96.   property, but having this property is no guarantee that a cryptosystem
  97.   is strong!''
  98.  
  99.   In contrast, the purpose of mathematical cryptology is to precisely
  100.   formulate and, if possible, prove the statement that a cryptosystem is
  101.   strong. We say, for example, that a cryptosystem is secure against
  102.   all (passive) attacks if any nontrivial attack against the system (as
  103.   defined above) is too slow to be practical. If we can prove this
  104.   statement then we have confidence that our cryptosystem will resist
  105.   any (passive) cryptanalytic technique. If we can reduce this statement
  106.   to some well-known unsolved problem then we still have confidence that
  107.   the cryptosystem isn't easy to break.
  108.  
  109.   Other parts of cryptology are also amenable to mathematical
  110.   definition. Again the point is to explicitly identify what assumptions
  111.   we're making and prove that they produce the desired results. We can
  112.   figure out what it means for a particular cryptosystem to be used
  113.   properly: it just means that the assumptions are valid.
  114.  
  115.   The same methodology is useful for cryptanalysis too. The cryptanalyst
  116.   can take advantage of incorrect assumptions. Often he can try to
  117.   construct a proof of security for a system, see where the proof fails,
  118.   and use these failures as the starting points for his analysis.
  119.   
  120. 4.4. Why is the one-time pad secure?
  121.  
  122.   By definition, the one-time pad is a cryptosystem where the
  123.   plaintexts, ciphertexts, and keys are all strings (say byte strings)
  124.   of some length m, and E_K(P) is just the sum (let's say the exclusive
  125.   or) of K and P.
  126.  
  127.   It is easy to prove mathematically that there are _no_ nontrivial
  128.   single-ciphertext attacks on the one-time pad, assuming a uniform
  129.   distribution of keys. Note that we don't have to assume a uniform
  130.   distribution of plaintexts. (Here's the proof: Let A be an attack,
  131.   i.e., an algorithm taking two inputs f, g and producing one output h,
  132.   with some probability p that h = H(P) whenever f = F(P) and
  133.   g = G(E_K(P)) (i.e., g = G(K + P)). Then, because the distribution of
  134.   K is uniform and independent of P, the distribution of K + P must also
  135.   be uniform and independent of P. But also the distribution of C is
  136.   uniform and independent of P. Hence there is probability exactly p
  137.   that h = H(P) whenever f = F(P) and g = G(C), over all P and C. Thus
  138.   a fortiori A is trivial.)
  139.  
  140.   On the other hand the one-time pad is _not_ secure if a key K is used
  141.   for more than one plaintext: i.e., there are nontrivial
  142.   multiple-ciphertext attacks. So to be properly used a key K must be
  143.   thrown away after one encryption. The key is also called a ``pad'';
  144.   this explains the name ``one-time pad.''
  145.  
  146. 4.5. What's a ciphertext-only attack?
  147.  
  148.   In the notation above, a ciphertext-only attack is one where F is
  149.   constant. Given only some information G(E_K(P_1),...,E_K(P_n)) about
  150.   n ciphertexts, the attack has to have some chance of producing some
  151.   information H(P_1,...,P_n) about the plaintexts. The attack is trivial
  152.   if it has just as good a chance of producing H(P_1,...,P_n) when given
  153.   G(C_1,...,C_n) for random C_1,...,C_n.
  154.  
  155.   For example, say G(C) = C, and say H(P) is the first bit of P. We can
  156.   easily write down an attack---the ``guessing attack,'' which simply
  157.   guesses that H(P) is 1. This attack is trivial because it doesn't use
  158.   the ciphertext: it has a fifty-fifty chance of guessing correctly no
  159.   matter what. On the other hand there is an attack on RSA which
  160.   produces one bit of information about P, with 100% success, using C.
  161.   If it is fed a random C then the success rate drops to 50%. So this is
  162.   a nontrivial attack.
  163.  
  164. 4.6. What's a known-plaintext attack?
  165.  
  166.   The classic known-plaintext attack has F(P_1,P_2) = P_1,
  167.   G(C_1,C_2) = (C_1,C_2), and H(P_1,P_2) depending only on P_2.
  168.   In other words, given two ciphertexts C_1 and C_2 and one decryption
  169.   P_1, the known-plaintext attack should produce information about the
  170.   other decryption P_2.
  171.  
  172.   Note that known-plaintext attacks are often defined in the literature
  173.   as producing information about the key, but this is pointless: the
  174.   cryptanalyst generally cares about the key only insofar as it lets him
  175.   decrypt further messages.
  176.  
  177. 4.7. What's a chosen-plaintext attack?
  178.  
  179.   A chosen-plaintext attack is the first of an increasingly impractical
  180.   series of _active_ attacks on a cryptosystem: attacks where the
  181.   cryptanalyst feeds data to the encryptor. These attacks don't fit into
  182.   our model of passive attacks explained above. Anyway, a
  183.   chosen-plaintext attack lets the cryptanalyst choose a plaintext and
  184.   look at the corresponding ciphertext, then repeat until he has figured
  185.   out how to decrypt any message. More absurd examples of this sort of
  186.   attack are the ``chosen-key attack'' and ``chosen-system attack.''
  187.  
  188.   A much more important form of active attack is a message corruption
  189.   attack, where the attacker tries to change the ciphertext in such a
  190.   way as to make a useful change in the plaintext.
  191.  
  192.   There are many easy ways to throw kinks into all of these attacks:
  193.   for instance, automatically encrypting any plaintext P as
  194.   T,E_K(h(T+R+P),R,P), where T is a time-key (sequence number) chosen anew
  195.   for each message, R is a random number, and h is a one-way hash
  196.   function. Here comma means concatenation and plus means exclusive-or.
  197.  
  198. 4.8. In mathematical terms, what can you say about brute-force attacks?
  199.  
  200.   Consider the following known-plaintext attack. We are given some
  201.   plaintexts P_1,...,P_{n-1} and ciphertexts C_1,...,C_{n-1}. We're
  202.   also given a ciphertext C_n. We run through every key K. When we find
  203.   K such that E_K(P_i) = C_i for every i < n, we print D_K(C_n).
  204.  
  205.   If n is big enough that only one key works, this attack will succeed
  206.   on valid inputs all the time, while it will produce correct results
  207.   only once in a blue moon for random inputs. Thus this is a nontrivial
  208.   attack. Its only problem is that it is very slow if there are many
  209.   possible keys.
  210.  
  211. 4.9. What's a key-guessing attack? What's entropy?
  212.  
  213.   Say somebody is using the one-time pad---but isn't choosing keys
  214.   randomly and uniformly from all m-bit messages, as he was supposed to
  215.   for our security proof. In fact say he's known to prefer keys which
  216.   are English words. Then a cryptanalyst can run through all English
  217.   words as possible keys. This attack will often succeed, and it's much
  218.   faster than a brute-force search of the entire keyspace.
  219.  
  220.   We can measure how bad a key distribution is by calculating its
  221.   entropy. This number E is the number of ``real bits of information''
  222.   of the key: a cryptanalyst will typically happen across the key within
  223.   2^E guesses. E is defined as the sum of -p_K log_2 p_K, where p_K is
  224.   the probability of key K.
  225.